<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head> 
<title>Login Page</title>
<script type="text/javascript" src="${ctx}/static/js/jquery-1.8.2.js"></script>
<script type="text/javascript">
	$(function(){
		$("#captcha").click(function(){
			var url = $(this).attr("src"); 
			url += "#"+Math.random();
			$(this).attr("src",url);
		});
	});
</script>
</head>
<body onload='document.f.j_username.focus();' style="text-align: center;">
	<h3>Hello Maven Login!!!</h3>
	信息:${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
	<hr/>
	<form name="f" action="${ctx}/j_spring_security_check"
		method="post">
		<table>
			<tr>
				<td>帐号:</td>
				<td><input type='text' name='j_username' value=''></td>
			</tr>
			<tr>
				<td>密码:</td>
				<td><input type='password' name='j_password' value=""/></td>
			</tr>
			<tr>
				<td></td>
				<td>
					<input type='text' name='captcha' style="width: 70px;"/>
					<img id="captcha" alt="点击刷新验证码" src="test/captchaInit.do" style="height: 30px;"/>
				</td>
			</tr>
			<tr>
				<td colspan='2'><input name="submit" type="submit"
					value="Login" /></td>
			</tr>
		</table>
	</form>
</body>
</html>